<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
  <head>
    <title> report </title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
    <?php htmlhead(); ?>
    <style>
      <!--
      .panel .t {text-indent:4px;background:#d7e7ee url(themes/images/icons.gif) scroll repeat 10px -32px;}      
      .panel b {cursor:pointer;font-size:14px;}
      .panel .m {width:108px;height:20px;line-height:19px;text-indent:5px;display:block;float:left;margin-top:1px;border:1px solid #efe;margin-right:4px;background:#000;}
      .panel .m em {float:right;margin-right:5px;color:#fff;}
      .panel .mm {width:84px;font-weight:bold;vertical-align:center;text-align:right;}
      -->
    </style>
  </head>
  
  <body>

    <div class="panel" id="accordion">
    
      <div class="t"><b title="点击可展开收缩">基本信息</b></div>
      <div>
        <dl>
          <dt>副本名称:</dt>
          <dd><?php echo $instance_name;?>　</dd>
        </dl>
        <dl>
          <dt>活动标题:</dt>
          <dd><?php echo $event_name;?>　</dd>
        </dl>
        <dl>
          <dt>开始时间:</dt>
          <dd><?php echo date("Y-m-d H:i:s",$report['start']);?>　</dd>
        </dl>
        <dl>
          <dt>结束时间:</dt>
          <dd><?php echo date("Y-m-d H:i:s",$report['end']);?>　</dd>
        </dl>
        <dl>
          <dt>活动备注:</dt>
          <dd><?php echo $report['note'];?>　</dd>
        </dl>
      </div>
        
      <div class="t"><b title="点击可展开收缩">参与人数[<span id="num_m"><?php echo count($report['members']);?></span>]</b></div>
      <div id="members">
        <table class="table">
          <tbody>
          <?php
          foreach($classes as $_=>$v) {
            echo('<tr style="'.($v['class_color'] ? 'color:'.$v['class_color'] : '').'">');
            echo('<td class="mm">'.$v['class_name'] . ': </td><td id="cc'.$v['class_id'].'" >');
            foreach($report['members'] as $_i=>$vv) {
              if($v['class_name']==$vv[2] || $v['class_en']==$vv[2]) {
                echo('<span class="m" id="n'.$_i.'">'.$vv[0].'<em>'.($earns[$vv[0]]-$spents[$vv[0]]).'</em></span>');
              }
            }
            echo('</td></tr>');
          }
          ?>
          </tbody>
        </table>
      </div>
        
      <div class="t"><b title="点击可展开收缩">相关事件[<span id="num_e"><?php echo count($report['events']);?></span>]</b></div>
        <div id="events">
        <table class="table" id="events">
          <thead>
            <tr>
              <th style="width:20px;"></th>
              <th style="width:300px;">事件名称</th>
              <th style="width:36px;">分数</th>
              <th style="width:120px;">时间</th>
              <th style="width:160px;">相关BOSS</th>
              <th style="width:auto;">参与情况</th>
            </tr>        
          </thead>
          <tbody>
          <?php
          foreach($report['events'] as $_=>$v) {
            echo('<tr id="e'.$_.'">');
            echo('<td class="status"></td>');
            echo('<td><strong class="green">'.$v[0] . '</strong></td>');
            echo('<td>'.$v[1] . '</td>');
            echo('<td>'.date("Y-m-d H:i:s",$v[3]) . '</td>');
            echo('<td>'. $v[2] . '</td>');
            echo('<td></td>');
            echo('</tr>');
          }
          ?>
          </tbody>
        </table>        
        </div>
        
      <div class="t"><b title="点击可展开收缩">物品拾取[<span id="num_i"><?php echo count($report['items']);?></span>]</b></div>
      <div id="items">
        <table class="table" id="items">
          <thead>
            <tr>
              <th style="width:20px;"></th>
              <th style="width:300px;">物品名称</th>
              <th style="width:40px;">数量</th>
              <th style="width:128px;">拾取者</th>
              <th style="width:60px;">单价</th>
              <th style="width:auto;"></th>
            </tr>        
          </thead>
          <tbody>
          <?php
          foreach($report['items'] as $_=>$v) {
            list($color,$itemid,$itemname) = explode("|",$v[0]);
            echo('<tr id="i'.$_.'">');
            echo('<td class="status"></td>');
            echo('<td><a class="tip" rel="item,'.$itemid.'"><strong style="color:#'.$color.';">['. $itemname . ']</strong></a></td>');
            echo('<td>'.$v[2] . '</td>');
            echo('<td>'. $v[3] . '</td>');
            echo('<td>'. $v[1] . '</td>');
            echo('<td></td>');
            echo('</tr>');
          }
          ?>
          </tbody>
        </table>        
      </div>
        
    </div>
      
    <script>
    
      $('#accordion [title]').tipsy({gravity:'w'});
      
      $('.panel .m').corner('6px');
      
      $('#accordion b').click(function() {
        $(this).parent().next().toggle('fast');
        return false;
      });
      
      $(".table tr").hover(function() {
        if ($(this).hasClass('trhover'))
          $(this).removeClass('trhover');
        else
          $(this).addClass('trhover');          
      });
      
      showTip("记录已经成功导入",null,4);

    </script>
    
</body>
</html>